<template>
  <div>
    <detail-banner :bannerImg="brandObj.banner_img"></detail-banner>
    <page-breadcrumbs :crumbData="crumbData"></page-breadcrumbs>
    <detail-summary :logo="brandObj.logo" :summary="brandObj.summary"></detail-summary>
    <detail-video :video="brandObj.attachment" :videoImg="brandObj.video_img"></detail-video>
    <detail-category :category="brandObj.category_info"></detail-category>
    <page-footer></page-footer>
  </div>
</template>

<script>
import DetailBanner from './components/Banner'
import PageBreadcrumbs from 'components/Breadcrumbs'
import DetailSummary from './components/Summary'
import DetailVideo from './components/Video'
import DetailCategory from './components/Category'
import PageFooter from 'components/Footer'
import brand from '@/model/brand'
export default {
  name: 'BrandDetail',
  components: {
    DetailBanner,
    PageBreadcrumbs,
    DetailSummary,
    DetailVideo,
    DetailCategory,
    PageFooter
  },
  data () {
    return {
      crumbData: [{
        title: '首页', jump: '/'
      }, {
        title: '合作品牌', jump: '/brand'
      }, {
        title: '品牌详情', jump: ''
      }],
      brandObj: {}
    }
  },
  async created () {
    await this.getBrandDetail()
  },
  methods: {
    async getBrandDetail () {
      try {
        const id = this.$route.params.id
        const brandResult = await brand.getBrandDetail(id)
        this.brandObj = brandResult.data.data
        console.log(this.brandObj)
      } catch (error) {
        if (error.code === 10020) {
          this.onlineBrandData = []
        }
      }
    }
  }
}
</script>

<style scoped>

</style>
